<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('审批预览')" />
    <style type="text/css">
        *{
            font-size: 16px;
            margin: 0px;
            padding: 0px;
        }
        p{
            line-height: 30px;
        }
        .indent{
            text-indent: 2em;
        }
        /* table{
             border: 1px black solid;
            border-collapse: collapse;
        }
        th, td{
            border: 1px black solid;

        } */
        th, td{
            border-left: 1px black solid;
            border-bottom: 1px black solid;
            position: relative;
            left: -1px;
            top: -1px;
            right: -1px;
            bottom: -1px;
        }
        .contentTable th,.contentTable td{
            border-top: 1px black solid;
        }
        .last-td{
            border-right: 1px black solid;
        }
    </style>
</head>
<body>
<div id="box" style="width: 683px;margin: 0px auto;">
    <div id="content" style="width: 683px; position: absolute; margin-top: 20px;">
        <div id="bgImg" style="position: absolute; left: -40px; top: -40px;right: -40px;bottom: 20px;overflow:hidden;z-index: -1;">
            <div style="width: 1500px;height: auto;margin-right:-1000px;clear: both;">
                <img src="../static/img/shuiyin.jpg" th:src="@{/img/shuiyin.jpg}" style="border: none;float: left;"/>
                <img src="../static/img/shuiyin.jpg" th:src="@{/img/shuiyin.jpg}" style="border: none;float: left;"/>
            </div>
        </div>
        <h2 style="margin: 40px; font-size: 30px;text-align: center;position: relative;">安宁区政府采购申报表</h2>
        <div style="position:absolute;right: 8px;top: 0px;">
            <img src="../static/img/zc.png" th:src="@{/img/zc.png}" width="120" height="120" />
        </div>
        <div style="padding-top: 10px;position: relative;">
            <span style="padding-left:1em;float: left;line-height: 40px;">项目编号: 安财采协<span th:text="${procurementDeclare.projectNumber}"></span> 号</span>
            <span style="float: right;line-height: 40px;"><span th:text="${#strings.substring(#dates.format(procurementDeclare.createTime, 'yyyy-MM-dd'),0,4)}"></span>  年<span th:text="${#strings.substring(#dates.format(procurementDeclare.createTime, 'yyyy-MM-dd'),5,7)}"></span> 月 <span th:text="${#strings.substring(#dates.format(procurementDeclare.createTime, 'yyyy-MM-dd'),8,10)}"></span> 日</span>
        </div>
        <table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-bottom: none;">
            <tr style="height: 30px;" class="contentTable">
                <th width="130" rowspan="2" >采购单位名称<br>（盖章）</th>
                <td width="240" rowspan="2" align="center" th:text="${procurementDeclare.unitName}"></td>
                <th width="60" rowspan="2">联系人</th>
                <td width="90" rowspan="2" align="center" th:text="${procurementDeclare.contactName}"></td>
                <th width="50">电话</th>
                <td align="center" class="last-td" th:text="${procurementDeclare.tel}"></td>
            </tr>
            <tr style="height: 30px;">
                <th>手机</th>
                <td align="center" class="last-td" th:text="${procurementDeclare.mobilePhone}"></td>
            </tr>
            <tr>
                <td colspan="6" style="border-bottom: none;" class="last-td">
                    <p class="indent">
                        根据我单位年度政府采购计划安排，拟对<span th:text="${procurementDeclare.projectName}"></span>  项目进行政府采购，共安排资金<span th:text="${#numbers.formatDecimal(procurementDeclare.expectMoney,1,'COMMA',2,'POINT')}"></span> 万元。现将采购名称、数量、价格及具体参数等上报，请安排采购。
                    </p>
                </td>
            </tr>
        </table>

        <table width="100%" border="0" cellspacing="0" cellpadding="0" id="goodsTable">
            <tr style="height: 30px;" class="contentTable"><th colspan="7" class="last-td">拟采购项目（具体技术参数及项目可后附清单）</th></tr>
            <tr style="height: 40px;">
                <th width="40">序号</th>
                <th width="60">名称</th>
                <th >品牌型号</th>
                <th width="50">计量<br/>单位</th>
                <th width="50">数量</th>
                <th width="90">单价（元）</th>
                <th width="90" class="last-td">金额（元）</th>
            </tr>
            <!--<c:if test="${beginNum==null&&endNum==null}">-->
                <!--<c:forEach var="declareGoods" items="${procurementDeclare.declareGoods}"  varStatus="vs">-->
                    <tr style="height: 25px;" class="tdContent" th:each="declareGoods:${procurementDeclare.declareGoods}">
                        <td align="center" th:text="${declareGoodsStat.count}"></td>
                        <td width="60" align="center" th:text="${declareGoods.goodsName}"></td>
                        <td align="center" th:text="${declareGoods.parameters}"></td>
                        <td align="center" th:text="${declareGoods.unit}"></td>
                        <td align="center" th:text="${declareGoods.number}"></td>
                        <td align="center" th:text="${#numbers.formatDecimal(declareGoods.price,1,'COMMA',2,'POINT')}"></td>
                        <td align="center" class="last-td" th:text="${#numbers.formatDecimal(declareGoods.sumPrice,1,'COMMA',2,'POINT')}"></td>
                    </tr>
                <!--</c:forEach>-->
            <!--</c:if>-->
            <!--<c:if test="${beginNum!=null&&endNum!=null}">-->
                <!--<c:forEach var="declareGoods" items="${procurementDeclare.declareGoods}" begin="${beginNum-1}"  end="${endNum-1}" varStatus="vs">-->
                    <!--<tr style="height: 25px;" class="tdContent" th:each="declareGoods:${procurementDeclare.declareGoods}">-->
                        <!--<td align="center" th:text="${declareGoodsStat.count}"></td>-->
                        <!--<td width="60" align="center" th:text="${declareGoods.goodsName}"></td>-->
                        <!--<td align="center" th:text="${declareGoods.parameters}"></td>-->
                        <!--<td align="center" th:text="${declareGoods.unit}"></td>-->
                        <!--<td align="center" th:text="${declareGoods.number}"></td>-->
                        <!--<td align="center" th:text="${#numbers.formatDecimal(declareGoods.price,1,'COMMA',2,'POINT')}"></td>-->
                        <!--<td align="center" class="last-td" th:text="${#numbers.formatDecimal(declareGoods.sumPrice,1,'COMMA',2,'POINT')}"></td>-->
                    <!--</tr>-->
                <!--</c:forEach>-->
            <!--</c:if>-->

            <tr id="btr" style="border-bottom: none;height:30px;">
                <th colspan="6" style="border-bottom: none;">合计</th>
                <td align="center" style="border-bottom: none;" class="last-td" th:text="${#numbers.formatDecimal(sumPrice,1,'COMMA',2,'POINT')}"></td>
            </tr>
        </table>

        <table width="100%" border="0" cellspacing="0" cellpadding="0" >
            <tr style="height: 160px;"class="contentTable">
                <td style="position:relative;width: 50%;" class="last-td">
                    <span style="position: absolute;left: 20px;top: 20px;">主管部门意见：</span>
                    <span style="position: absolute;left: 3em;top: 4em;">（盖章）</span>
                    <span style="position: absolute;right: 20px;bottom: 20px;">年<span style="width: 30px;display: inline-block;"></span>月<span style="width: 30px;display: inline-block;"></span>日</span>
                </td>
                <td  style="position:relative;width: 50%; border-left: none;" class="last-td">
                    <span style="position: absolute;left: 20px;top: 20px;">财政局业务主管科室意见：</span>
                    <span style="position: absolute;right: 20px;bottom: 20px;">年<span style="width: 30px;display: inline-block;"></span>月<span style="width: 30px;display: inline-block;"></span>日</span>
                </td>
            </tr>
            <tr style="height: 160px;">
                <td style="position:relative;width: 50%;border-top: none;" class="last-td">
                    <span style="position: absolute;left: 20px;top: 20px;">政府采购办审核意见：</span>
                    <span style="position: absolute;left: 3em;top: 5em;">（盖章）</span>
                    <span style="position: absolute;right: 20px;bottom: 20px;">年<span style="width: 30px;display: inline-block;"></span>月<span style="width: 30px;display: inline-block;"></span>日</span>
                </td>
                <td style="position:relative;width: 50%;border-left: none;border-top: none;" class="last-td">
                    <span style="position: absolute;left: 20px;top: 20px;">政府采购分管领导审批意见：</span>
                    <span style="position: absolute;right: 20px;bottom: 20px;">年<span style="width: 30px;display: inline-block;"></span>月<span style="width: 30px;display: inline-block;"></span>日</span>
                </td>
            </tr>
        </table>
        <p></p>
        <form id="preForm" action="goLookApprove.action" method="get" style="margin-top:20px; margin-left:20px; float:left;">
            <input type="hidden" name="procurementDeclareId" th:value="${procurementDeclare.procurementDeclareId}">
            <span>打印</span>
            <select id="selectBegin" name="beginNum">
                <!--<c:forEach var="declareGoods" items="${procurementDeclare.declareGoods}" varStatus="vs">-->
                    <option th:value="${declareGoodsStat.count+1}" th:each="declareGoods:${procurementDeclare.declareGoods}" th:text="${declareGoodsStat.count+1}"></option>
                <!--</c:forEach>-->
            </select>
            <span>到</span>
            <select id="selectPage" name="endNum">
                <!--<c:forEach var="declareGoods" items="${procurementDeclare.declareGoods}" varStatus="vs">-->
                    <!--<option value="${vs.index+1}" 	<c:if test="${fn:length(procurementDeclare.declareGoods)==(vs.index+1)}"> selected="selected" </c:if> >${vs.index+1}</option>-->
                <!--</c:forEach>-->
                <option th:value="${declareGoodsStat.count+1}" th:each="declareGoods:${procurementDeclare.declareGoods}" th:selected="${#lists.size(procurementDeclare.declareGoods) eq (declareGoodsStat.count+1)}" th:text="${declareGoodsStat.count+1}"></option>
            </select>
            <span>条</span>

            <input type="submit" id="previewBtn" value="预览"/>
        </form>
        <button onclick="printPage(this)" style="float: right;margin-bottom: 20px;margin-top: 20px;padding: 10px 20px;">打印</button>
        <button id="jhtr" onclick="jhtr()" style="float: right;margin-bottom: 20px;margin-top: 20px;margin-right: 20px;padding: 10px 20px;display: none;">减行</button>
        <button id="zjtr" onclick="zjtr()" style="float: right;margin-bottom: 20px;margin-top: 20px;margin-right: 20px;padding: 10px 20px;">增行</button>
    </div>
</div>
<th:block th:include="include :: footer" />

<script type="text/javascript">
    function printPage(obj){
        $(obj).remove();
        $("#preForm").remove();
        $("#jhtr").remove();
        $("#zjtr").remove();
        var ua = navigator.userAgent.toLowerCase();
        window.print();
    }
    function jhtr(){
        var tr = $("#btr").prev();
        if(tr.prev().text().replace(" ", "") != ""){
            $("#jhtr").hide();
        }

        if(tr.text().replace(" ", "") == ""){
            tr.remove();
        }
    }
    function zjtr(){
        var tr = '<tr style="height: 25px;"><td align="center"><span></span></td>' +
                '<td align="center"><span></span></td><td><span></span></td>' +
                '<td align="center"><span></span></td><td align="center"><span></span></td>' +
                '<td align="center"><span></span></td><td align="center" class="last-td"><span></span></td></tr>';
        $("#btr").before(tr);
        $("#jhtr").show();
        img();
    }
    function img(){
        var obj = $("#bgImg>div:first");
        var h1 = $("#bgImg").height();
        var h2 = obj.find("img:first").height();
        var c = parseInt(h1/h2);
        var len = $("#bgImg>div").length;
        for(var i = 0; i <= c - len; i++){
            $("#bgImg").append('<div style="width: 1500px;height: auto;margin-right:-1000px;clear: both;">' +
                    '<img src="../web/images/shuiyin.jpg" style="border: none;float: left;"/>' +
                    '<img src="../web/images/shuiyin.jpg" style="border: none;float: left;"/></div>');
        }
    }
    function tabFont(){
        var tableHeight = $("#goodsTable").height();
        var fontSize=16;
        while(tableHeight>395 && fontSize>8){
            fontSize--;
            $(".tdContent td").css("font-size",fontSize+"px");
            $(".tdContent td").css("line-height",fontSize+"px");
            tableHeight = $("#goodsTable").height();
        }
    }
</script>
</body>
</html>